<template>
  <div class="notice">
    <i class="el-icon-bell"
      ><span>{{ number }}</span></i
    >
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import { getPlatformNum } from "@/api/system/platform";
import Cookies from "js-cookie";
export default {
  name: "InformData",
  data() {
    return {
        number: null,
        timer:null,
    };
  },
  computed: {},
  mounted() {
    this.getList();
    this.startRefresh();
  },
  beforeDestroy() {
    this.stopRefresh();
  },
  methods: {
    getList() {
      getPlatformNum().then((res)=>{
        this.number=res.data;
      })
    },
    startRefresh(){
      this.timer = setInterval(() => {
        this.getList();
      }, 5000);
    },
     stopRefresh() {
      clearInterval(this.timer);
    }
  },
};
</script>
<style lang="scss" scoped>
.el-icon-bell:before {
  content: "";
  font-weight: 700;
  font-size: 18px;
}
span {
  text-align: center;
  font-size: 14px;
  border-radius: 50%;
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  transform: translate(-9px, -11px);
  background-color: #fc2a2a;
  color: #ffffff;
}
</style>